#include <iostream>
#include <functional>

using namespace std;

void callFunc(int x, const function<void(int)> &f)
{
    if (x % 2 == 0)
    {
        f(x);
    }
}

void output(int x)
{
    cout << x << endl;
}

void output_add(int x)
{
    cout << x + 10 << endl;
}

int main()
{
    auto f1 = bind(output, placeholders::_1);
    for (int i = 0; i < 10; i++)
    {
        callFunc(i, f1);
    }
    cout << endl;
    auto f2 = bind(output_add, placeholders::_1);
    for (int i = 0; i < 10; i++)
    {
        callFunc(i, f2);
    }
    cout << endl;
    return 0;
}